package com.newland.esp.service.user.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.newland.esp.common.util.DataResult;
import com.newland.esp.entity.user.UserEntity;
import com.newland.esp.mapper.user.UserMapper;
import com.newland.esp.service.user.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @param
 * @author lw
 * @descripe
 * @date 2021/8/13 21:26
 * @Version 1.0
 **/
@Service("UserService")
public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity>
implements UserService {

    @Resource
    UserMapper userMapper;



    @Override
    public DataResult getStarById(String id) {

        UserEntity user = userMapper.selectStarById(id);
        return DataResult.success(user);
    }

    @Override
    public DataResult addUser(UserEntity userEntity) {
        int insert = userMapper.insert(userEntity);
        if(insert > 0){
            return DataResult.success();
        }
        return DataResult.error();
    }
}
